package com.zl.controller;

import com.zl.service.CompanyService;
import com.zl.service.UserService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;

/**
 * Created by zhLEi on 2016/4/29.
 */
@Controller
public class CompanyController {
    @Autowired
    private CompanyService companyService;


    @RequestMapping(value = "/company/findAll", method = RequestMethod.GET)
    public
    @ResponseBody
    JSONObject findAll() {
        return new JSONObject().accumulate("companies", companyService.findAll());
    }

}
